/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package mx.its.dsw2.veterinarySystem.dao;

import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;
import mx.its.dsw2.veterinarySystem.modelo.DetalleExamen;
import mx.its.dsw2.veterinarySystem.modelo.Examen;

/**
 *
 * @author 100101
 */
@Stateless
public class DetalleExamenDao extends AbstractDao<DetalleExamen> implements DetalleExamenDaoLocal {
    @PersistenceContext(unitName = "veterinarySystem-ejbPU")
    private EntityManager em;

    @Override
    protected EntityManager getEntityManager() {
        return em;
    }

    public DetalleExamenDao() {
        super(DetalleExamen.class);
    }

    @Override
    public List<DetalleExamen> getListByExam(Examen exam) {
         Query q=em.createNamedQuery("DetalleExamen.findByIdExamen");
        q.setParameter("idExamen", exam.getId());
        return q.getResultList();
     
    }
    
    
}
